﻿//-----------------------------------------------------------------------
// <copyright file="WatchedVar.cs" company="Adrien Siffermann">
//      Copyright © Adrien Siffermann 2008-2009. All rights reserved.
// </copyright>
// <summary>This file contains implementation of the WatchedVar class.</summary>
// <website>http://sovfxcoprules.codeplex.com/</website>
//-----------------------------------------------------------------------

namespace SharePoint.FxCop.BestPracticesRules
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Microsoft.FxCop.Sdk;

    /// <summary>
    /// <see cref="WatchedVar"/> defines a var to be watched because it has to be disposed
    /// </summary>
    public class WatchedVar
    {
        #region Constructors
        /// <summary>
        /// Initializes a new instance of the <see cref="WatchedVar"/> class.
        /// </summary>
        public WatchedVar()
        {
            this.WatchedProperties = new List<WatchedVar>();
            this.IsDisposed = false;
            this.TargetedNode = null;
            this.ResolutionName = String.Empty;
        }
        #endregion

        #region Public Properties
        /// <summary>
        /// Gets or sets the name.
        /// </summary>
        /// <value>The name of the var.</value>
        public string Name { get; set; }

        /// <summary>
        /// Gets the watched properties.
        /// </summary>
        /// <value>The watched properties.</value>
        public List<WatchedVar> WatchedProperties { get; private set; }

        /// <summary>
        /// Gets or sets a value indicating whether this instance is disposed.
        /// </summary>
        /// <value>
        ///     <c>true</c> if this instance is disposed; otherwise, <c>false</c>.
        /// </value>
        public bool IsDisposed { get; set; }

        /// <summary>
        /// Gets or sets the full name of the type.
        /// </summary>
        /// <value>The full name of the type.</value>
        public string TypeFullName { get; set; }

        /// <summary>
        /// Gets or sets the targeted node.
        /// </summary>
        /// <value>The targeted node.</value>
        public Node TargetedNode { get; set; }

        /// <summary>
        /// Gets or sets the attached resolution.
        /// </summary>
        /// <value>The attached resolution.</value>
        public string ResolutionName { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether ignore problems.
        /// </summary>
        /// <value><c>true</c> if ignore problems; otherwise, <c>false</c>.</value>
        public bool IgnoreProblems { get; set; }
        #endregion
    }
}
